home *** CD-ROM | disk | FTP | other *** search
- class classes.fx.Star
- {
- var sA;
- var sO;
- var sI;
- var hv;
- var hc;
- var r = 8;
- var hyper = false;
- var hyper2 = false;
- var make = true;
- var Name = "star";
- function Star()
- {
- this.sA = new Array();
- this.sO = new Object();
- this.sI = 0;
- }
- function deathHead()
- {
- this.r = 10;
- }
- function stopIt()
- {
- this.make = false;
- }
- function showPlanet(which)
- {
- this.sO["planet" + this.sI] = new Object();
- var _loc3_ = this.sO["planet" + this.sI];
- _loc3_.id = this.sI;
- _loc3_.yMov = _root.randRange2(-0.3,-0.5);
- if(which == "moon")
- {
- _loc3_.yMov = -1.2;
- }
- _root.d = _root.d + 1;
- _loc3_.clip = _root.attachMovie("planets","planet" + this.sI + "Clip",_root.d - 5000);
- _loc3_.clip._x = random(550) + 200;
- _loc3_.clip._y = 755;
- _loc3_.clip.gotoAndStop(which);
- _loc3_.clip.cacheAsBitmap = true;
- this.sA.push(_loc3_);
- this.sI = this.sI + 1;
- }
- function hyperSpace(plvl)
- {
- var _loc4_ = plvl;
- this.hv = _loc4_ != 2 ? 1.015 : 1.01;
- this.hyper = _root.hyper = true;
- this.hc = 0;
- var _loc3_ = 0;
- var _loc5_ = this.sA.length;
- while(_loc3_ < _loc5_)
- {
- this.sA[_loc3_].clip.starClip.play("level" + _loc4_);
- _loc3_ = _loc3_ + 1;
- }
- }
- function endHyper()
- {
- this.hv = 1.005;
- this.hyper2 = true;
- this.hc = 0;
- var _loc2_ = 0;
- var _loc3_ = this.sA.length;
- while(_loc2_ < _loc3_)
- {
- this.sA[_loc2_].clip.starClip.play("end");
- _loc2_ = _loc2_ + 1;
- }
- }
- function phase2()
- {
- this.r = 15;
- }
- function makeStars()
- {
- var _loc4_ = 0;
- while(_loc4_ < 40)
- {
- this.sO["star" + this.sI] = new Object();
- var _loc3_ = this.sO["star" + this.sI];
- _loc3_.id = this.sI;
- _loc3_.depth = random(9) + 1;
- _loc3_.yMov = -1 * (_loc3_.depth / 2) * ((_root.level - 1) * 0.3 + 1);
- _root.d = _root.d + 1;
- _loc3_.clip = _root.attachMovie("star","star" + this.sI + "Clip",_root.d - 9000);
- _loc3_.clip._x = random(1001);
- _loc3_.clip._y = random(603);
- _loc3_.clip._alpha = _loc3_.depth * 10;
- _loc3_.clip.gotoAndStop(_root.randRange(_root.starColors[0],_root.starColors[1]));
- this.sA.push(_loc3_);
- this.sI = this.sI + 1;
- _loc4_ = _loc4_ + 1;
- }
- }
- function deleteAll()
- {
- var _loc3_ = 0;
- var _loc5_ = this.sA.length;
- while(_loc3_ < _loc5_)
- {
- var _loc4_ = this.sA[_loc3_];
- _loc4_.clip.removeMovieClip();
- _loc3_ = _loc3_ + 1;
- }
- _root.removeFX("star");
- }
- function main()
- {
- if(this.hyper)
- {
- this.r = 3;
- this.hc = this.hc + 1;
- if(this.hc < 120)
- {
- var _loc6_ = 0;
- var _loc7_ = this.sA.length;
- while(_loc6_ < _loc7_)
- {
- this.sA[_loc6_].yMov *= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- }
- if(this.hc > 480)
- {
- _loc6_ = 0;
- _loc7_ = this.sA.length;
- while(_loc6_ < _loc7_)
- {
- this.sA[_loc6_].yMov /= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- }
- if(this.hc == 560)
- {
- this.hyper = _root.hyper = false;
- this.hc = 0;
- this.r = 15;
- }
- }
- if(this.hyper2)
- {
- this.r = 3;
- this.hc = this.hc + 1;
- if(this.hc < 240)
- {
- _loc6_ = 0;
- _loc7_ = this.sA.length;
- while(_loc6_ < _loc7_)
- {
- this.sA[_loc6_].yMov *= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- }
- if(this.hc > 1560)
- {
- _loc6_ = 0;
- _loc7_ = this.sA.length;
- while(_loc6_ < _loc7_)
- {
- this.sA[_loc6_].yMov /= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- }
- if(this.hc == 1800)
- {
- this.hyper2 = false;
- this.hc = 0;
- this.r = 15;
- }
- }
- if(random(this.r - _root.level * 2) == 0 && this.make)
- {
- this.sO["star" + this.sI] = new Object();
- var _loc4_ = this.sO["star" + this.sI];
- _loc4_.id = this.sI;
- _loc4_.depth = random(9) + 1;
- _loc4_.yMov = -1 * (_loc4_.depth / 2) * ((_root.level - 1) * 0.3 + 1);
- if(this.hyper)
- {
- if(this.hc < 120)
- {
- _loc6_ = 0;
- do
- {
- _loc4_.yMov *= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- while(_loc6_ < this.hc);
-
- }
- if(this.hc > 119)
- {
- _loc6_ = 0;
- do
- {
- _loc4_.yMov *= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- while(_loc6_ < 120);
-
- }
- if(this.hc > 559)
- {
- _loc6_ = 0;
- do
- {
- _loc4_.yMov /= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- while(_loc6_ < this.hc - 560);
-
- }
- }
- if(this.hyper2)
- {
- if(this.hc < 240)
- {
- _loc6_ = 0;
- do
- {
- _loc4_.yMov *= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- while(_loc6_ < this.hc);
-
- }
- if(this.hc > 239)
- {
- _loc6_ = 0;
- do
- {
- _loc4_.yMov *= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- while(_loc6_ < 240);
-
- }
- if(this.hc > 1559)
- {
- _loc6_ = 0;
- do
- {
- _loc4_.yMov /= this.hv;
- _loc6_ = _loc6_ + 1;
- }
- while(_loc6_ < this.hc - 1560);
-
- }
- }
- _root.d = _root.d + 1;
- _loc4_.clip = _root.attachMovie("star","star" + this.sI + "Clip",_root.d - 9000);
- _loc4_.clip._x = random(1001);
- _loc4_.clip._y = 603;
- _loc4_.clip._alpha = _loc4_.depth * 10;
- _loc4_.clip.gotoAndStop(_root.randRange(_root.starColors[0],_root.starColors[1]));
- if(this.hyper)
- {
- var _loc8_ = this.hv != 1.015 ? 0 : 600;
- _loc4_.clip.starClip.gotoAndPlay(this.hc + _loc8_);
- }
- else if(this.hyper2)
- {
- _loc4_.clip.starClip.gotoAndPlay(this.hc + 1400);
- }
- this.sA.push(_loc4_);
- this.sI = this.sI + 1;
- }
- _loc6_ = 0;
- _loc7_ = this.sA.length;
- while(_loc6_ < _loc7_)
- {
- _loc4_ = this.sA[_loc6_];
- _loc4_.clip._y += _loc4_.yMov;
- if(_loc4_.clip._y < -5)
- {
- _loc4_.clip.removeMovieClip();
- var _loc3_ = 0;
- var _loc5_ = this.sA.length;
- while(_loc3_ < _loc5_)
- {
- if(_loc4_ == this.sA[_loc3_])
- {
- this.sA.splice(_loc3_,1);
- }
- _loc3_ = _loc3_ + 1;
- }
- delete this.sO["star" + _loc4_.id];
- }
- _loc6_ = _loc6_ + 1;
- }
- if(!this.make)
- {
- if(this.sA.length < 3)
- {
- _root.removeFX("star");
- }
- }
- if(!this.make)
- {
- _loc6_ = 0;
- _loc7_ = this.sA.length;
- while(_loc6_ < _loc7_)
- {
- _loc4_ = this.sA[_loc6_];
- _loc4_.yMov += 0.0075;
- if(_loc4_.yMov > 0)
- {
- _loc4_.yMov = 0;
- }
- _loc6_ = _loc6_ + 1;
- }
- }
- }
- }
-